package jun.dev.transparentservice;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.widget.Toast;

public class TPView extends ViewGroup{
    private Paint mLoadPaint;
    private Paint mBackGround;

    public TPView(Context context) {
        super(context);
        Toast.makeText(getContext(),"HUDView", Toast.LENGTH_LONG).show();

        mLoadPaint = new Paint();
        mLoadPaint.setAntiAlias(true);
        mLoadPaint.setTextSize(30);
        mLoadPaint.setARGB(255, 255, 255, 82);
        
        mBackGround = new Paint();
        mBackGround.setARGB(255, 255, 100, 100);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
      canvas.drawText("Hello World", 0, 50, mLoadPaint);
        canvas.drawRect(100,  100, 100, 100, mBackGround);
    }

    @Override
    protected void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4) {
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        //return super.onTouchEvent(event);
//        Toast.makeText(getContext(),"onTouchEvent", Toast.LENGTH_LONG).show();
    	Log.e("TP2","Touch");

        return true;
    }
}
